home *** CD-ROM | disk | FTP | other *** search
/ Aminet 37 / Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso / Aminet / dev / lang / sofa.lha / sofa / smalleiffel / lib_std / memory.e < prev    next >
Text File  |  2000-03-25  |  2KB  |  65 lines

  1. -- This file is  free  software, which  comes  along  with  SmallEiffel. This
  2. -- software  is  distributed  in the hope that it will be useful, but WITHOUT 
  3. -- ANY  WARRANTY;  without  even  the  implied warranty of MERCHANTABILITY or
  4. -- FITNESS  FOR A PARTICULAR PURPOSE. You can modify it as you want, provided
  5. -- this header is kept unaltered, and a notification of the changes is added.
  6. -- You  are  allowed  to  redistribute  it and sell it, alone or as a part of 
  7. -- another product.
  8. --          Copyright (C) 1994-98 LORIA - UHP - CRIN - INRIA - FRANCE
  9. --            Dominique COLNET and Suzanne COLLIN - colnet@loria.fr 
  10. --                       http://SmallEiffel.loria.fr
  11. --
  12. expanded class MEMORY
  13. --
  14. -- Facilities for tuning up the garbage collection, and
  15. -- everything about memory control.
  16. --
  17.  
  18. feature -- Status Report :
  19.  
  20.    frozen collecting: BOOLEAN is
  21.          -- Is garbage collection enabled ?
  22.       do
  23.          c_inline_c("R=!gc_is_off;%N");
  24.       end;
  25.    
  26. feature -- Status setting :
  27.  
  28.    frozen collection_off is
  29.          -- Disable garbage collection.
  30.       do
  31.          c_inline_c("gc_is_off=1;%N");
  32.       end;
  33.    
  34.    frozen collection_on is
  35.          -- Enable garbage collection.
  36.       do
  37.          c_inline_c("gc_is_off=0;%N");
  38.       end;
  39.  
  40. feature -- Removal :
  41.  
  42.    dispose is
  43.          -- Action to be executed just before garbage collection 
  44.          -- reclaims an object.
  45.       do
  46.       end;
  47.  
  48.    frozen full_collect is
  49.          -- Force a full collection cycle if garbage collection is
  50.          -- enabled; do nothing otherwise.
  51.       do
  52.          if collecting then
  53.             c_inline_c("gc_start();%N");
  54.          end;
  55.       end;
  56.  
  57. feature -- The Guru section (low level memory management) :
  58.  
  59.    pointer_size: INTEGER is
  60.          -- The size in number of bytes for a pointer.
  61.       external "SmallEiffel"
  62.       end;
  63.  
  64. end -- MEMORY
  65.